#ifndef _SERVER_H
#define _SERVER_H

#include <stdio.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <arpa/inet.h>
#include <string.h>
#include <stdlib.h>
#include <sys/epoll.h>
#include <time.h>

#include "hw_type.h"
#include "iota_init.h"
#include "iota_login.h"
#include "iota_cfg.h"
#include "LogUtil.h"
#include "cJSON.h"
#include "iota_error_type.h"
#include "iota_datatrans.h"
#include "StringUtil.h"

typedef struct 
{
	int fd;
	char name[100];
} Client_t;

#define SERVER_PORT 10000

#define MAX_CLIENT 1024

extern int server_setReuseAddr(int fd_socket);
extern int server_bindAddr(int fd_socket,int port);
extern int server_socketInit();
extern void server_clientsInit(Client_t *clients);
extern int server_getClientAddr(int fd_client,struct sockaddr_in *addr_client);
extern int server_run(int fd_socket,Client_t *clients);
extern char* server_getCurTime();

#endif